#ifndef QUADTREE_H
#define QUADTREE_H
#include "Object.h"
#include <vector>

using namespace std;

class Quadtree {
public:
                        Quadtree(float x, float y, float width, float height, int level, int maxLevel);

                        ~Quadtree();

    void					AddObject(Object *object);
    vector<Object*>				GetObjectsAt(float x, float y);
    void					Clear();
    float					x;
    float					y;
    float					width;
    float					height;
    int					level;
    int					maxLevel;
    vector<Object*>				objects;

    Quadtree *				parent;
    Quadtree *				NW;
    Quadtree *				NE;
    Quadtree *				SW;
    Quadtree *				SE;

    bool					contains(Quadtree *child, Object *object);
};


#endif // QUADTREE_H
